#include "ALLMenu.h"
#include "Show.h"

PlayMenu01::PlayMenu01(IMenu *FM) {
	FatherMenu = FM;
	Name.push_back("Return");
	Name.push_back("Next Turn");
	Name.push_back("Pause");
	NextMenu = new IMenu*[item];
	NextMenu[0] = FatherMenu;
	NextMenu[1] = this;
	NextMenu[2] = new PauseMenu(this, FatherMenu);
}

PlayMenu01::~PlayMenu01() {
	/*for(int i = 0; i < item; i++) {
		delete NextMenu[i];
	}*/
	delete NextMenu[2];
	delete[] NextMenu;
}

std::string PlayMenu01::GetMyName() {
	return Myname;
}

bool PlayMenu01::process() {
	int opt = -1;
	DemoValue++;
	while(opt == -1) {
		Show show(this);
		show.Display();
		Choose chs;
		opt = chs.Option(this);
	}
	if(NextMenu[opt] == FatherMenu) {
		Reset();
	}
	MenuMgr::getInstance().SetActiveMenu(NextMenu[opt]);
	return !OVER;
}

std::string PlayMenu01::GetChildName(int k) {
	return Name[k];
}

int PlayMenu01::GetItem() {
	return item;
}

int PlayMenu01::GetDemoValue() {
	return DemoValue;
}

void PlayMenu01::Reset() {
	DemoValue = 0;
}

void PlayMenu01::SetValue(int sv) {
	DemoValue = sv;
}
